<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
            <meta charset="utf-8">
            <title><?php echo ($seo_title); ?></title>
            <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
            <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black">
            <meta name="format-detection" content="telephone=no" />
            <meta name="format-detection" content="email=no" />
            <meta name="keywords" content="<?php echo ($seo_keywords); ?>" />
            <meta name="description" content="<?php echo ($seo_description); ?>">
            <meta name="screen-orientation" content="portrait">
            <meta name="x5-orientation" content="portrait">
            <link rel="shortcut icon" href=" /favicon.ico" />
            <link rel="apple-touch-icon" href="/icon.png" />
            <link rel="apple-touch-start-image" href="/start.png" />

            <link rel="stylesheet" type="text/css" href="/Static/mobile/css/style.css">
            <link rel="stylesheet" type="text/css" href="/Static/mobile/css/SpsBtn.css">
            <script src="/Static/mobile/js/jquery.js"></script>
            <script src="/Static/mobile/js/layer.mobile-v1.6/layer.m.js"></script>
            <script src="/Static/mobile/js/common.js?i=1"></script>
            <script src="/Static/mobile/js/jquery.lazyload.min.js"></script>
            <link rel="stylesheet" type="text/css" href="/Static/mobile/iconfont/iconfont.css">
            <link rel="stylesheet" href="//at.alicdn.com/t/font_813618_4lm1s8y9h0t.css">
            <script>
                var _hmt = _hmt || [];
                (function() {
                  var hm = document.createElement("script");
                  hm.src = "https://hm.baidu.com/hm.js?a524f349a84f50ed8afa8dcd907a59e9";
                  var s = document.getElementsByTagName("script")[0]; 
                  s.parentNode.insertBefore(hm, s);
                })();
            </script>
<?php if(!$is_mobile){ ?>
        <style>
html,body{
    height:100%;
    width:50%;
    margin:0 auto;
}
.nav{
    position:fixed;
    width:25%;

}
.morder_nav{
	position:absolute;
}
</style>
<?php } ?>
	</head>
<body>
    
	<link rel="stylesheet" type="text/css" href="/Static/mobile/css/goodsdetail.css" />
<link rel="stylesheet" type="text/css" href="/Static/mobile/css/carbuy.css" />
<div class="membersbox pad50">
    <style>

.mdetail_bottom {
    width: 100%;
    position: fixed;
    z-index: 11;
    width:100%;
    bottom: 0;
    height: 50px;
    background: #fff;
    border-top: 1px solid #E9E9E9;
}
.mdetail_name .price,.mdetail_name .price{
		color:#e6207a;
	}

    </style>
    
<?php echo W('Slide/goods',array($goods));?>

		<section class="mdetail_name">
			<div class="title"><?php echo $goods['goods_name'];?></div>
			<div class="price">
				<span class="symbol">¥</span>

				 <span class="number"> 
				 <?php echo $goods['shop_price'];?> 
				 </span> 

				 
				 <?php if($goods['is_hot']){?>
				 	<span class="status">热卖</span>
				 <?php } ?>
				 
				 <?php if($goods['is_new']){?>
				 	<span class="status">新品</span>
				 <?php } ?>
				 
				 <?php if($goods['is_tejia']){?>
				 	<span class="status">特价</span>
				 <?php }?>

			</div>
			<div class="otherinfo clearfix">
			
				<?php if($goods['market_price']){ ?>
				<span>原价：<s>¥<?php echo $goods['market_price'];?></s></span> 
				<?php } ?>
				
				<?php $full_baoyou = C("FULL_BAOYOU");?>
				
				<span>销量：<em><?php echo $goods['sale_basic']+$goods['sale_real'];?></em></span>
				
				<?php if($goods['is_shiwu']){ ?>
					 <?php if($jiage>=$full_baoyou || $goods['freight_payer'] == 1){?>
					 		<span>运费：<em>包邮</em></span>
					 <?php }else { ?>
						<span>运费：<em>满<?php echo $full_baoyou;?>元包邮</em></span>
					<?php } ?>
				<?php } ?>
				
			</div>

		</section>

		<!-- 点赞、分享 -->
		<!-- icon_praised表示已经赞过，若没赞则没有这个类 -->
<?php if(false){ ?>
<section class="sharedetail clearfix">
	<div class="detailPraise">
	<h4 class="clearfix" onclick="vote();">
		<p class="fl icon_common praise_class <?php echo $vtype?'icon_praise':'icon_praised';?>" id="vote"></p>
		<p class="shareinfo fl">点赞<br><span id="votenums"><?php echo $goods['vote_nums'];?></span></p>
	</h4>
	</div>
	<div class="detailshare">
		<h4 class="j-share clearfix" id="fxBtn">
			<p class="fl icon_common icon_share"></p>
			<p class="shareinfo nopraise fl share-link">分享</p>
		</h4>
	</div>     
</section>
<?php } ?>


		<section class="mdetail_goodsdet">
			<section class="mdetail_goodsdet_tit">
				<span class="cur" style="width:100%;">商品介绍<i></i></span> 
				<!-- TODO <span class="">评价（0）<i></i></span>-->
			</section>
			<section class="mdetail_goodsdet_con"> 
				<section class="detailConPanel" style="left: 0px;">

						<div class="fulltext">
							<?php echo htmlspecialchars_decode($goods['goods_desc']);?>
						</div>
						<!-- 商品详情二维码 -->
							<div class="detailCode" style="text-align:center">
							<!--  <img src="#<?php echo $goods['goods_id'];?>" width="60%" style="vertical-align: middle;" alt="">-->
							</div>

					<div class="detailCon" style="display: none;">
						<div class="j-detail-comment">
							<!-- 评论 -->
						</div>
					</div>
				</section>
			</section>
		</section>
		<section class="mdetail_bottom">

			<section class="cart bdbox" style="width:32%;">
				<a href="/mobile/cart/mycart"><img src="/Static/mobile/images/del5.png" width="50" height="50"></a> 
				<b id="J-addone-cartnum"><?php echo $cartNum;?></b> <em id="J-addone">+1</em>
			</section>
 
			<section class="actions bdbox clearfix">
			
							<!--   <?php if($memberinfo['grade_id'] <= 2){?>
				 	

				  <a href="javascript:void(0)" class="nobuy" >CEO会员请联系皇冠下单</a>
				


				 <?php }else{?>
			 <?php } ?>
			-->
			
			
				  <a href="javascript:;" need_guige="0" class="<?php echo empty($goods['guige'])&&!$guige_new ? 'btn-popupSKU-addcart' : 'j-openPopupSKU';?>" >加入购物车</a>
				
				 <?php if(!$nobuy){ ?>
				 <a  href="javascript:;" style="background:#e6207a;" need_guige="0" class="<?php echo empty($goods['guige'])&&!$guige_new ? 'btn-popupSKU-buynow' : 'j-openPopupSKU buynow';?>">立即购买</a>
				 <?php }else{ ?>
				 <a  href="javascript:;" class="btn">商品未开售</a>
				 <?php } ?>
				 
				 
				 
			
			</section>
		</section>
		
<?php if(!empty($goods['guige']) OR !empty($guige_new)){ ?>		
<section class="popup-sku bdbox" id="j-popup-sku" style="display: none; transform: translate3d(0px, 0px, 0px);">
	<a href="javascript:;" class="btn-close j-close-popupSKU"></a>
	<section class="sku-top bdbox clearfix">
         <div class="photo" style="background-image:url(<?php echo C('UPYUN_DOMAIN').$goods['goods_pic'];?>!headimgurl)" id="j-popupSKU-img"></div>

         <div class="goods_info bdbox">
             <p class="price">
                 <span class="prefix"></span>
                 <span class="priceText">¥<i class="j-price"><?php echo $goods['shop_price'];?></i></span>
             </p>

             <p class="stock"><span class="j-stock">　</span></p>              
               <p class="selectedStatus j-selectedSKU" id="please_guige" style="display:none">请选择规格</p>

         </div>
	</section>

    <section class="mdetail_infor popup bdbox" style="margin-bottom:60px;">
        
        <!--  
        <dl class="number-control">
            <dd class="clearfix" >
                <div class="title fl" >购买数量</div>
                                    <div class="ctrl fr clearfix">
                    <a href="javascript:;" class="md_min">-</a>
                    <input type="tel" value="1" class="md_text appearance" id="j-stocknum-ipt" data-maxnum="9999">
                    <a href="javascript:;" class="md_add">+</a>
                </div>
            </dd>
        </dl>
        -->
        
        
        <?php foreach($goods['guige_name'] as $kk=>$vv){?>
        <dl class="number-control" >
            <dd class="clearfix" >
                <div class="title"><?php echo $kk;?></div>
                <div class="ctrl clearfix guige_em">
                <?php foreach($vv as $kkk=>$vvv){ ?>
                    <em class="guige" kid="<?php echo $kkk;?>" guige_id="<?php echo $vvv['guige_id'];?>" child=""><?php echo $vvv['name'];?></em>
				<?php } ?>
                </div>
            </dd>
        </dl>
        <?php } ?>
		<div id="guige-group">
		<?php foreach($guige_new as $kk=>$vv){?>
        <dl class="number-control" >
            <dd class="clearfix" >
                <div class="title"><?php echo $guige_names[$kk];?></div>
                <div class="ctrl clearfix guige_em guige_new">
                <?php foreach($vv as $kkk=>$vvv){ ?>
                    <em class="guige" guige-x="<?=$kk?>" guige-y="<?=$kkk?>" child=""><?php echo $vvv;?></em>
				<?php } ?>
                </div>
            </dd>
        </dl>
        <?php } ?>
        </div>
    </section>

    <section class="actions bdbox clearfix">
    

				 
        <a href="javascript:;" class="fl btn-next bdbox j-addCart addCart btn-popupSKU-addcart" need_guige="1" style="display: block;">加入购物车</a>
        <!--end 加入购物车 -->

        <a href="javascript:;" class="fl btn-next bdbox j-buyNow buyNow btn-popupSKU-buynow" need_guige="1" style="display: none;background:#e6207a;">立即购买</a>
        <!--end 立即购买 -->
        
				
    
    
    
    


    </section> 
</section>
			
<section class="j-close-popupSKU" id="overlay" style="display: none;"></section>		
<?php } ?>		
					

		<!-- 底部按钮 -->
	<script type='text/javascript'>
    (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
            (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
            s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
    })(window, document, 'script', '_MEIQIA');
    _MEIQIA('entId', 132278);
</script>
<script>
        var winHeight = $(window).height();  //获取当前页面高度
        $(window).resize(function () {
            var thisHeight = $(this).height();
            if ( winHeight - thisHeight > 140 ) {
                //键盘弹出
                $('.bottom-fixed').hide();
            } else {
                //键盘收起
                $('.bottom-fixed').show();
            }
        })
</script>
<script>
       /*  $('body').on('click','#meiqiakefu',function(){
            $('#MEIQIA-BTN-ICON').click();
        }); */
        function showMeiqia() {
            $('#MEIQIA-BTN-ICON').click();
            location.href= location.href+'#sdsd';
        }
</script>

<?php if($memberinfo['uid']!=1481) { ?>
    <style>
        #MEIQIA-BTN {
            display:none;
        }
    </style>
<?php } ?>

</div>

<input type="text" value="" style="display:none" id="chose_kid">
<script>
var goods_guige = '<?php echo json_encode($goods['guige']);?>';
guige_obj = eval("("+goods_guige+")");
goods_id = "<?php echo $goods['goods_id'];?>";
</script>
<script src="/Static/mobile/js/carbuy.js"></script>



	<div id="mmexport">
		<img src="/Static/mobile/images/mmexport.png" width="100%" alt="">
	</div>
	<div id="mmexport-pl" style="display: none;">
		<img src="/Static/mobile/images/mmexport1.png" width="100%" alt="">
	</div>
	<div id="mmexport-share" style="display: none;">
		<img src="/Static/mobile/images/mmexport2.png" width="100%" alt="">
	</div>
	
	
	<!-- 悬浮按钮 -->
	<div class="mask_menu" id="menubtn" style="display: none;"></div>
	<div class="menu" id="menufloat" <?php if(isset($goods['is_xuanfu']) && ($goods['is_xuanfu'] == 0)){ ?>style="display:none;"<?php } ?>>
		<i class="icon-menu"></i>
	</div>
	
	
	<div class="menu-c notel nofocus" id="menufloat-c" <?php if(isset($goods['is_xuanfu']) && ($goods['is_xuanfu'] == 0)){ ?>style="display:none;"<?php } ?>>
		<div class="menu-c-out">
			<div class="menu-c-inner">
				<a class="a-home" href="/mobile" title="首页" style="display: block;"></a> 
				<a class="a-tel" href="tel://<?php echo C('SITE_TEL');?>" title="联系店主" style="display: inline;"></a>
				<a class="a-member" href="/mobile/cart/mycart" title="购物车" style="display: block;"></a> 
				<a class="a-search" href="/mobile/user/index" title="会员" style="display: block;"></a> 
				<a class="a-cart" href="javascript:;" id="share-link" title="分享" style="display: block;"></a>
				<a class="a-collect" href="javascript:void(0)" id="collect-link" title="收藏" style="display: block;"></a> 
				<a class="a-server" href="/mobile/goods/lists" title="搜索" style="display: block;"></a>
			</div>
		</div>
	</div>



	<!-- 收藏 -->
	<div class="collectbg">
		<img src="/Static/mobile/images/collectbg.png" width="100%" alt=""><a href="javascript:;" class="a-know">我知道了</a>
	</div>
	
	<!-- 分享 -->
	<div class="sharebg">
		<img src="/Static/mobile/images/mmexport.png" width="100%" alt=""><a href="javascript:;" class="a-know">我知道了</a>
	</div>
	
	<sectoin class="loading" id="j-loading"></sectoin>
<script type="text/javascript" src="/Static/mobile/js/swipe.js"></script>

<script>
    var IsShop="";//是否是首页

    $(function(){

                
        $(document).on('touchend',"#mmexport",function(){
            $(this).hide();
        });
        $(document).on('touchend',"#mmexport-pl",function(){
            $(this).hide();
        });
        $(document).on('touchend',"#mmexport-share",function(){
            $(this).hide();
        });



                        (function(){
            // 控制添加商品的图片显示高度，确保商品布局正常
            $('.b_mingoods,.mingoods').each(function(index, el) {
                var me = $(this),
                    imgHeight = me.find('img').width();
                me.find('img').closest('a').height(imgHeight);
            });
            $('.board3').each(function(index, el) {
                var me = $(this);
                var bwidth = me.width();
                if(me.hasClass('small_board') || !me.hasClass('big_board')){
                    me.children('span').attr('style', 'height:'+bwidth+'px !important;overflow:hidden;');
                }
                if(me.hasClass('big_board')){
                    me.children('span').attr('style', 'height:'+(bwidth*2+10)+'px !important;overflow:hidden;');
                }
            });

            // 悬浮按钮
            var SpsBtn = {
                config:{
                    menu:document.getElementById('menufloat'),
                    menusub:document.getElementById('menufloat-c'),
                    menubtn:document.getElementById('menubtn')
                },
                init:function(){
                    this.SpsbtnClick();
                    this.touchMove();
                },
                touchMove:function(){
                    var _this = this;
                    _this.config.menu.addEventListener('touchmove',function(e){
                        e.preventDefault();
                        var touch = e.touches[0],
                            moveX,moveY,
                            winWh = window.innerWidth - 50,
                            winHt = window.innerHeight - 50;
                        moveX = touch.clientX -25;
                        moveY = touch.clientY -25;
                        moveY  = moveY  < 0 ? 0 : moveY ;
                        moveX = moveX < 0 ? 0 : moveX;
                        moveY = moveY > winHt ? winHt : moveY;
                        moveX = moveX > winWh ? winWh :moveX;
                         _this.config.menu.style.left = moveX + 'px';
                         _this.config.menu.style.top = moveY + 'px';
                         _this.config.menusub.style.left = moveX + 10 + 'px';
                         _this.config.menusub.style.top = moveY -190 + 'px';
                    },false)
                    
                    
                },
                SpsbtnClick:function(){
                    var _this = this;
                    this.config.menu.addEventListener('click',function(){
                        var me = $(this);
                        // console.log(me)
                        if(!me.hasClass('show')){
                            me.addClass('show');
                            me.siblings('.mask_menu,#menufloat-c').show();
                            me.siblings('#menufloat-c').find('.menu-c-inner').addClass('in').removeClass('outer')
                        }else{
                            me.removeClass('show');
                            me.siblings('.mask_menu,#menufloat-c').hide();
                            me.siblings('#menufloat-c').find('.menu-c-inner').removeClass('in').addClass('outer')
                        }
                    },false);
                    this.config.menubtn.addEventListener('click',function(){
                        $(_this.config.menu).removeClass('show');
                        $(_this.config.menu).siblings('.mask_menu,#menufloat-c').hide();
                        $(_this.config.menu).siblings('#menufloat-c').find('.menu-c-inner').removeClass('in').addClass('outer')
                    })
                }
            }
            SpsBtn.init();            // 收藏按钮
            $('#collect-link').click(function(event) {
                $('.menu').removeClass('show');
                $('.mask_menu').hide();
                $('.menu-c-inner').removeClass('in').addClass('outer')
                $('.collectbg').show();
            });
            $('.a-know').click(function(event) {
                $(this).parent('.collectbg,.sharebg').hide();
            });
            // 分享
            $('#share-link').click(function(event) {
                return false;
                $('.menu').removeClass('show');
                $('.mask_menu').hide();
                $('.menu-c-inner').removeClass('in').addClass('outer')
                $('.sharebg').show();
            });
            
            $('.share-link').click(function(event) {
                return false;
                $('.menu').removeClass('show');
                $('.mask_menu').hide();
                $('.menu-c-inner').removeClass('in').addClass('outer')
                $('.sharebg').show();
            }); 
            
            
        })();


	// 购物车数据
/*
	var carturl = "#";
	$.post("/Shop/getCartNum",{},function(data) {
		var html = '<a href="'+carturl+'" class="navCart" id="navCart"><span>'+ data.num + '</span></a>';
		$("#htmlReplace-navCart").replaceWith(html);
			if (data.num > 0) {
				$("#navCart").show();
				} else {
					$("#navCart").hide();
		}
}, "json");
	*/
	
	
	
	
});

	</script>
	
	
<script>
//image lazyload
$(function(){
    $("img.lazyload").lazyload({
        threshold:650
    });
});
</script>
<!-- 如果是微信客户端 -->
<input id="networkType" value="" type="hidden">
<?php if($is_wechat){ ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
		wx.config({
		
		<?php if($hlopenid =="oaGjOtyJCTObWB2BZbkLfxyVHTMA"){?>
		 debug:true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，
		
		<?php } ?>
		
		  //若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		  appId:'<?php echo ($jssign['appid']); ?>', // 必填，公众号的唯一标识
		  timestamp:'<?php echo ($jssign['timestamp']); ?>', // 必填，生成签名的时间戳
		  nonceStr:'<?php echo ($jssign['noncestr']); ?>', // 必填，生成签名的随机串
		  signature:'<?php echo ($jssign['signature']); ?>',// 必填，签名，见附录1
	      jsApiList: [
	                  'checkJsApi',
	                  'onMenuShareTimeline',
	                  'onMenuShareAppMessage',
	                  'onMenuShareQQ',
	                  'onMenuShareWeibo',
	                  'onMenuShareQZone',
	                  'hideMenuItems',
	                  'showMenuItems',
	                  'hideAllNonBaseMenuItem',
	                  'showAllNonBaseMenuItem',
	                  'translateVoice',
	                  'startRecord',
	                  'stopRecord',
	                  'onVoiceRecordEnd',
	                  'playVoice',
	                  'onVoicePlayEnd',
	                  'pauseVoice',
	                  'stopVoice',
	                  'uploadVoice',
	                  'downloadVoice',
	                  'chooseImage',
	                  'previewImage',
	                  'uploadImage',
	                  'downloadImage',
	                  'getNetworkType',
	                  'openLocation',
	                  'getLocation',
	                  'hideOptionMenu',
	                  'showOptionMenu',
	                  'closeWindow',
	                  'scanQRCode',
	                  'chooseWXPay',
	                  'openProductSpecificView',
	                  'addCard',
	                  'chooseCard',
	                  'openCard'
	                ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		
		wx.ready(function(){
			//分享到朋友圈
		  wx.onMenuShareTimeline({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    success: function(){
		    	
		    },
		    cancel: function(){
		    }
		  });
		  //分享给好友
		  wx.onMenuShareAppMessage({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    desc:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    type: '',
		    dataUrl: '',
		    success: function () { 
		    },
		    cancel: function () { 
		
		    }
		  });  
		  
		  wx.getNetworkType({
			    success: function (res) {
			        var networkType = res.networkType; // 返回网络类型2g，3g，4g，wifi
			        $("#networkType").val(networkType);
			    }
			});
		  
		  //复制链接menuItem:copyUrl
		  wx.hideMenuItems({
			 menuList: ["menuItem:originPage",
			            "menuItem:share:facebook",
			            "menuItem:share:qq",
			            "menuItem:share:weiboApp",
			            "menuItem:share:QZone",
			            "menuItem:readMode",
			         //   "menuItem:openWithQQBrowser",
			         //   "menuItem:openWithSafari",
			            "menuItem:share:email",
			            "menuItem:share:brand",
			            "menuItem:copyUrl",//复制链接
			            "menuItem:share:timeline",//朋友圈
			            "menuItem:share:appMessage",//朋友
			            ], // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
		      success: function (res) {
		         // alert('已隐藏“阅读模式”，“分享到朋友圈”，“复制链接”等按钮');
		        },
		        fail: function (res) {
		          //alert(JSON.stringify(res));
		        }
		  });
		  
		  //wx.hideOptionMenu();//批量隐藏保护类 传播类按钮
		 
		});

		//浏览图片
		function previewImage(now_pic,pics){
			wx.previewImage({
			   current: now_pic, // 当前显示图片的http链接
			   urls: pics // 需要预览的图片http链接列表
			});
		}
		
		//浏览图片
		$('.previewImageList').on('click', function(){
			var now_pic = $(this).attr("src");
			var pics = new Array();
			
			$('.previewImage').each(function(index) {
				pics[index] = $(this).attr("src");
			 });
			
			previewImage(now_pic,pics);
			
		});

		</script>

<?php } ?>
<script>

var plusobj = {
    createDownload: function (url,callbackFunction) {
        let dtask = plus.downloader.createDownload(url);
        dtask.addEventListener( "statechanged", callbackFunction, false );
        dtask.start(); 
    },
    delFile: function (relativePath) {
        plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
            entry.remove(function(entry) {
                console.log("文件删除成功==" + relativePath);
            }, function(e) {
                console.log("文件删除失败=" + relativePath);
            });
        });
    },
    shareWeixinPic: function  (files,scene) {
        var self = this;
        plus.share.getServices( function(s){
            var shares = s;
            shares.forEach((item)=>{
              if(item.id='weixin') {
                item.send( {pictures:files,extra:{scene:scene?scene:"WXSceneSession"}}, function(){
                  
                }, function(e){
                  self.delFile(file)
                });
              }
            })
          }, function(e){
            alert( "获取分享服务列表失败："+e.message );
          } );
    },
	shareMsg: function  (msg) {
        var self = this;
        plus.share.getServices( function(s){
            var shares = s;
            shares.forEach((item)=>{
              if(item.id='weixin') {
                item.send(msg, function(){
                }, function(e){
                });
              }
            })
          }, function(e){
          } );
    }
}

function myshare () {
	plus.nativeUI.actionSheet({
		title: '分享到',
		cancel: "取消",
		buttons: [{
			title: "微信消息"
		}, {
			title: "微信朋友圈"
		}]
	}, function(e) {
		var index = e.index;
		if(index<0) {
			return false;
		}
		switch(index) {
			case 1: //分享到微信好友
				plusobj.shareMsg({
					title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
					content:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
					href: '<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>',//分享出去后，点击跳转地址
					thumbs: ['<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>'], //分享缩略图
					extra:{scene:"WXSceneSession"}
				});
				break;
			case 2: //分享到微信朋友圈
				plusobj.shareMsg({
					title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
					content:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
					href: '<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>',//分享出去后，点击跳转地址
					thumbs: ['<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>'], //分享缩略图
					extra:{scene:"WXSceneTimeline"}
				});
				break;
		}
	})
}

document.addEventListener("plusready",function(){
	var token = plus.storage.getItem('token');
	if(token) {
		
		$.get('/mobile/login/tokenLogin?token='+token).then(function(res){
			if(res.ret==1) {
				//清除storage
				plus.storage.removeItem('token');
			}else{
				//alert('登录成功');
			}
		})
	}
	//plus.webview.currentWebview().setStyle({titleNView: {buttons: []}});
	if(plus.os.name=='Android') {
		/* if(plus.runtime.version=='1.0') {
			var url="http://ui.vip36.cn/android2.apk"; 
			var dtask = plus.downloader.createDownload( url, {}, function ( d, status ) {
				if ( status == 200 ) { 
					var path = d.filename;
					plus.runtime.install(path);
				} else {
					alert( "Download failed: " + status ); 
				}  
			});
			dtask.start(); 
		} */
	}
},false);

</script>
<style>
        .morder_nav section.cur, .morder_nav section.cur a {
            color:#e6207a;
        }
        .morder_nav section i {
            background-color: #e6207a;
        }
        .weui-btn_primary{
            background-color: #e6207a;
        }
        .Integral{
            background-color: #e6207a;  
        }
        .van-button--primary {
            color: #fff;
            background-color: #e6207a;
            border: 1px solid #e6207a;
        }
        .swiper-pagination-bullet-active{
            background-color: #e6207a;
        }
        .mdetail_goodsdet_tit span.cur{
            color: #e6207a;
        }
        .mdetail_goodsdet_tit span i{
            background-color: #e6207a;
        }

    </style>
<script>
//image lazyload
$(function(){
    $("img.lazyload").lazyload({
        threshold:650
    });
});
<?php if($showad) { ?>
var html = '<div><?php echo htmlspecialchars_decode(C('AD_DETAIL'));?></div>';
var pageii = layer.open({
  type: 1
  ,content: html
  ,anim: 'up'
  ,style: 'position:fixed;overflow:scroll; left:0%; top:0%; width:100%; height:100%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s;'
});      
var adHeight = $('#showad').height();
$('.layui-m-layercont').css('height',adHeight+'px');
$('.layermanim').css('height',adHeight+'px');
$('img').css('width','100%');

setTimeout(function() {
    layer.closeAll();
}, <?=C('AD_TIME')*1000?>);

<?php } ?>

</script>

</body>
</html>